<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>诊疗进度信息</title>
    <!-- 引入element-ui样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
    <div id="app">
        <el-table :data="tableData" stripe border style="width: 100%">
            <el-table-column prop="administrativeName" label="科室" >
            </el-table-column>
            <el-table-column prop="doctorName" label="医师" >
            </el-table-column>
            <el-table-column prop="doctorDuty" label="职称" width="180">
            </el-table-column>
            <el-table-column prop="checkedCount" label="已诊人数">
            </el-table-column>
            <el-table-column prop="waitCheckCount" label="侯诊人数">
            </el-table-column>
            <el-table-column prop="currPatient" label="当前患者">
            </el-table-column>
            <el-table-column prop="waitPatientList" label="侯诊患者">
            </el-table-column>
        </el-table>
    </div>
    <script>
        //获取当前日期
        function curentTime() {
            var now = new Date();
            var year = now.getFullYear();       //年
            var month = now.getMonth() + 1;     //月
            var day = now.getDate();            //日
            var hh = "00";            //时
            var mm = "00";          //分
            var ss = "00";          //分
            var clock = year + "-";
            if(month < 10)
                clock += "0";
            clock += month + "-";
            if(day < 10)
                clock += "0";
            clock += day + " ";
            clock +=hh+":"+mm+":"+ss;
            return clock;
        }
        setInterval("curentTime()",1000*3);
        var app=new Vue({
            el:"#app",
            data:{
                tableData:[],
            },
            mounted:function () {
                this.queryDiagnoseSchedule();
            },
            created: function () {//这里是定时器
                setInterval(this.queryDiagnoseSchedule, 1000*3);
            },
            methods:{
                queryDiagnoseSchedule:function () {
                    var vm =this;
                    var date=curentTime();
                    var params={date:date};
                    axios.get("medical/doctor/getDiagnosisSchedule",{params:params}).then(function (resp) {
                        vm.tableData=resp.data.data;
                    })
                }
            }
        });
    </script>
</body>
</html>